<?php

/*

Create Auctions (auctions_create.php)

*/

$page_title = "Create Auctions";
$rank_check = 1;
include "header.inc.php";

print "$openHTML";

$getitems = mysql_query("SELECT * FROM usersitems2 WHERE owner = '$userid' AND game = '$game' ORDER BY item_id");
while ($getitems2 = mysql_fetch_array($getitems))
{
	$get_item = fetch("SELECT * FROM items2 WHERE id = '$getitems2[item_id]' AND game = '$game'");
	$itemList .= "<option value=$getitems2[id]>$get_item[item_name]";
}

ECHO <<<END

<p align=center><a href=auctions.php?game=$game&page=search&search_by=my_auctions>My Auctions</a> | <a href=auctions.php?game=$game>Auction Home</a></p>

<P><FORM ACTION="auctions.php?game=$game&page=search" METHOD=POST>
   <CENTER><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=400>
      <TR BGCOLOR="$topAndBottomBG">
         <TD HEIGHT=45>
            <CENTER><FONT SIZE="+3" COLOR="$topAndBottomText"><B>--Auctions--</B></FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD HEIGHT=25>
            <CENTER><FONT SIZE="-1">Order by: </FONT><A HREF="auctions.php?game=$game&page=search&orderby=ending_soonest"><FONT SIZE="-1">Ending Soonest</FONT></A><FONT SIZE="-1">, </FONT><A HREF="auctions.php?game=$game&page=search&orderby=ending_last"><FONT SIZE="-1">Ending Last</FONT></A><FONT SIZE="-1">, </FONT><A HREF="auctions.php?game=$game&page=search&orderby=highest_price"><FONT SIZE="-1">Highest
            Price</FONT></A><FONT SIZE="-1">, </FONT><A HREF="auctions.php?game=$game&page=search&orderby=lowest_price"><FONT SIZE="-1">Lowest
            Price</FONT></A></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$reallyLight">
         <TD HEIGHT=25>
            <CENTER><FONT SIZE="-1">Search where:<SELECT NAME=search_by>
               <OPTION VALUE="item_name_contains">Item Name Contains
               <OPTION VALUE="item_name_is">Item Name IS
               <OPTION VALUE="owner">Owner IS
            </SELECT></FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD HEIGHT=25>
            <CENTER><FONT SIZE="-1">The words:
            <INPUT TYPE=text NAME=search_for VALUE="" SIZE=22></FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$reallyLight">
         <TD>
            <CENTER><INPUT TYPE=submit NAME=Submit VALUE="Search Auctions!"></CENTER>
         </TD>
      </TR>
   </TABLE>
   </CENTER>
</FORM></P>

<CENTER><FORM ACTION="auctions_create.pro.php?game=$game" METHOD=POST>
   <CENTER><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=400>
      <TR BGCOLOR="$topAndBottomBG">
         <TD COLSPAN=2 HEIGHT=45>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText"><B>--Create
            Auctions--</B></FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=100 HEIGHT=35>
            <P>Auction Item:</P>
         </TD>
         <TD HEIGHT=35>
            <P><SELECT NAME="auction_item">
               <OPTION>Chose an Item
               $itemList
            </SELECT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$reallyLight">
         <TD WIDTH=100 HEIGHT=35>
            <P>Starting Price:</P>
         </TD>
         <TD HEIGHT=35>
            <P><INPUT TYPE=text NAME="start_price" VALUE="0" SIZE=14 MAXLENGTH=7></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=100 HEIGHT=35>
            <P>Buy Now Price:</P>
         </TD>
         <TD HEIGHT=35>
            <P><INPUT TYPE=text NAME="buy_now_price" VALUE="0" SIZE=14 MAXLENGTH=7><BR>
            <FONT SIZE="-1">(optional!)</FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$reallyLight">
         <TD WIDTH=100 HEIGHT=35>
            <P>End In:</P>
         </TD>
         <TD HEIGHT=35>
            <P><SELECT NAME=end_in>
               <OPTION VALUE=1800>30 Minutes
               <OPTION VALUE=3600>1 Hour
               <OPTION VALUE=7200>2 Hours
               <OPTION VALUE=14400>6 Hours
               <OPTION VALUE=28800>12 Hours
               <OPTION VALUE=57600>24 Hours
               <OPTION VALUE=115200>48 Hours
            </SELECT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=100 HEIGHT=35>
            <P>Min Increment:</P>
         </TD>
         <TD HEIGHT=35>
            <P><INPUT TYPE=text NAME="min_increment" VALUE="0" SIZE=14 MAXLENGTH=5><BR>
            <FONT SIZE="-1">(50,000 max!)</FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$reallyLight">
         <TD COLSPAN=2 HEIGHT=35>
            <CENTER><INPUT TYPE=submit NAME=Submit VALUE="Create Auction!"></CENTER>
         </TD>
      </TR>
   </TABLE>
   </CENTER>
</FORM></CENTER>
END;

print "$closeHTML";
?>